package com.gopay.common.cps.dao.acct.impl;

import com.gopay.common.base.dao.impl.BaseDAOImpl;
import com.gopay.common.cps.dao.acct.AcctBalanceWarningDao;
import com.gopay.common.domain.acps.AcctBalanceWarning;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * CLASSNAME:AcctBalanceWarningDaoImpl
 * Description:余额预警Dao实现类
 * DATE:2017/12/18/018
 * AUTHER:PANSHICHAO
 * www.gopay.com.cn Inc.All rights reserved.
 */
@Repository("acctBalanceWarningDao")
public class AcctBalanceWarningDaoImpl extends BaseDAOImpl<AcctBalanceWarning,String> implements AcctBalanceWarningDao {
    @Override
    public List<AcctBalanceWarning> showAllBalanceWarningInfoByAcctId(String acctId) {
        String hql = "from AcctBalanceWarning where acctID =:acctID";
        Map<String,Object> param = new HashMap<String,Object>();
        param.put("acctID",acctId);
        List<AcctBalanceWarning> resultList = this.findByHql(hql,param);
        if(resultList == null){
            return null;
        }else{
            return resultList;
        }
    }

    @Override
    public List<AcctBalanceWarning> showAllBalanceWarningInfoByCustId(String custId) {
        String hql = "from AcctBalanceWarning where custID =:custID";
        Map<String,Object> param = new HashMap<String,Object>();
        param.put("custID",custId);
        List<AcctBalanceWarning> resultList = this.findByHql(hql,param);
        if(resultList == null){
            return null;
        }else{
            return resultList;
        }
    }
}
